//
//  MKTChatLinkButton.m
//  MKUITestApp
//
//  Created by 苏尚进 on 2021/7/9.
//  Copyright © 2021 moon. All rights reserved.
//

#import "MKTChatLinkButton.h"

@implementation MKTChatLinkButton
- (id)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        self.contentInsets = UIEdgeInsetsMake(9, 15, 9, 15);
        [self setTitleColor:[UIColor colorWithRed:0 green:0.5 blue:1 alpha:1].mk_grayColor forState:UIControlStateNormal];
        [self setTitleColor:[UIColor colorWithRed:0 green:0.25 blue:0.5 alpha:1].mk_grayColor forState:UIControlStateHighlighted];
        self.titleLabel.font = [UIFont boldSystemFontOfSize:14];
        self.clipsToBounds = YES;
        self.layer.borderColor = [UIColor colorWithRed:0 green:0.5 blue:1 alpha:1].mk_grayColor.CGColor;
        self.layer.borderWidth = 1;
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    CGRect bounds = self.bounds;
    self.layer.cornerRadius = MIN(bounds.size.width,bounds.size.height)*0.5;
}
- (CGSize)sizeThatFits:(CGSize)size{
    CGSize s = [super sizeThatFits:CGSizeMake(size.width, 32)];
    return s;
}
@end
